package org.spring.boot.async;

import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * 在spring boot的启动类中获取IOC的bean
 * 
 * @author liubin
 *
 * @date 2018年3月2日下午3:26:08
 */
@ComponentScan
public class Springboot3Application {

    public static void main(String[] args) throws Exception {

        ConfigurableApplicationContext context =
                SpringApplication.run(Springboot3Application.class, args);

        context.getBean(CountNumber.class).PrintNumber();
        for (int i = 1; i < 10; i++) {
            System.out.println("------------------");
        }
        context.close();
    }
}
